package com.hlkj.interceptor;

import com.hlkj.session.Session;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.Interceptor;
/**
 * 判断是否登录拦截器
 * @author zhukui
 */
public class PermissionInterceptor implements Interceptor {
	private static final long serialVersionUID = 1L;

	public void destroy() {
	}

	public void init() {
	}

	public String intercept(ActionInvocation invocation) throws Exception {
		Object user = Session.getSession().get("User");
		if (null != user) {
			return invocation.invoke();
		} else {
			return "errors";
		}
	}

}
